const state = () => ({
  content: {
    activeIndex: '1',
    activeIndex2: '1',
    comType: [
      /*{
        type: "OPPO专区", content: [
          {
            imgUrl: "https://dsfs.oppo.com/archives/202105/2021052010053360a5cf2d8a44e.png?_w_=1310&amp;_h_=950", //展示商品系列图片，从该系列中找出第一个商品的第一个图片
            contentUrl: "", //第一个商品的编号
            proName: "Find X3", //系列名称
            status: "新品" //系列状态
          },
          {
            imgUrl: "https://dsfs.oppo.com/archives/202105/2021051910054260a472766b792.png?_w_=320&amp;_h_=232",
            contentUrl: "",
            proName: "Find X3 Pro",
            status: "新品"
          },
          {
            imgUrl: "https://dsfs.oppo.com/archives/202105/202105060605506093c03249bab.png?_w_=1310&amp;_h_=949",
            contentUrl: "",
            proName: "Reno5",
            status: "新品"
          },
          {
            imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610215f9be831e31cc.png",
            contentUrl: "",
            proName: "K9",
            status: "新品"
          },
          {
            imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610475f9be84b7a808.png",
            contentUrl: "",
            proName: "Reno6",
            status: "新品"
          }
        ]
      },
      {type: "一加专区",content: [
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021052010053360a5cf2d8a44e.png?_w_=1310&amp;_h_=950",contentUrl: "",proName: "Find X3",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021051910054260a472766b792.png?_w_=320&amp;_h_=232",contentUrl: "",proName: "Find X3 Pro",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/202105060605506093c03249bab.png?_w_=1310&amp;_h_=949",contentUrl: "",proName: "Reno5",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610215f9be831e31cc.png",contentUrl: "",proName: "K9",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610475f9be84b7a808.png",contentUrl: "",proName: "Reno6",status: "新品"}
        ]},*/
      /*{type: "realme专区",content: [
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021052010053360a5cf2d8a44e.png?_w_=1310&amp;_h_=950",contentUrl: "",proName: "Find X3",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021051910054260a472766b792.png?_w_=320&amp;_h_=232",contentUrl: "",proName: "Find X3 Pro",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/202105060605506093c03249bab.png?_w_=1310&amp;_h_=949",contentUrl: "",proName: "Reno5",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610215f9be831e31cc.png",contentUrl: "",proName: "K9",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610475f9be84b7a808.png",contentUrl: "",proName: "Reno6",status: "新品"}
        ]},
      {type: "品牌",content: [
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021052010053360a5cf2d8a44e.png?_w_=1310&amp;_h_=950",contentUrl: "",proName: "Find X3",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021051910054260a472766b792.png?_w_=320&amp;_h_=232",contentUrl: "",proName: "Find X3 Pro",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/202105060605506093c03249bab.png?_w_=1310&amp;_h_=949",contentUrl: "",proName: "Reno5",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610215f9be831e31cc.png",contentUrl: "",proName: "K9",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610475f9be84b7a808.png",contentUrl: "",proName: "Reno6",status: "新品"}
        ]},
      {type: "另外",content: [
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021052010053360a5cf2d8a44e.png?_w_=1310&amp;_h_=950",contentUrl: "",proName: "Find X3",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/2021051910054260a472766b792.png?_w_=320&amp;_h_=232",contentUrl: "",proName: "Find X3 Pro",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202105/202105060605506093c03249bab.png?_w_=1310&amp;_h_=949",contentUrl: "",proName: "Reno5",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610215f9be831e31cc.png",contentUrl: "",proName: "K9",status: "新品"},
          {imgUrl: "https://dsfs.oppo.com/archives/202010/202010300610475f9be84b7a808.png",contentUrl: "",proName: "Reno6",status: "新品"}
        ]}*/
    ],
    tempShowData: [],
    isShowPro: false,
    twoLeave: true,
  }
})

const getters = {
  getData(state) {
    return state.content;
  },
  refreshTopNavSessionStorageData(state){
    sessionStorage.setItem("TopNav",JSON.stringify(state.content.comType));
  }
}

const actions = {
  loadData({commit},payload){//将后台的数据加载进去
    commit("loadDataMut",payload);
  },
  addDataBySessionStorage({commit}){
    commit("addDataBySessionStorageMut");
  }
}

const mutations = {
  loadDataMut(state,val){//将后台的数据加载进去
    state.content.comType = val;
  },
  addDataBySessionStorageMut(state){
    state.content.comType = [...JSON.parse(sessionStorage.getItem("TopNav"))];
  }
}

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
